using System;
using System.Collections.Generic;
using System.Text;
using RadinfMagazynier3.Forms;

namespace RadinfMagazynier3.Tools
{
    class SettingsTools
    {
        public static long GetDefaultVatID()
        {
            long id = -1;
            if (MainForm.DataSource.SETTINGS.Rows.Count == 1)
            {
                id = RadinfTools.ConvertToLong(MainForm.DataSource.SETTINGS.Rows[0]["DEF_VAT"]);
            }
            else
            {
                RadinfTools.ShowError("SettingsTools.GetDefaultVatID()", Globals.ERRORS.NO_SETTINGS_ROW);
            }
            return id;
        }

        public static long GetDefaultMeasureID()
        {
            long id = -1;
            if (MainForm.DataSource.SETTINGS.Rows.Count == 1)
            {
                id = RadinfTools.ConvertToLong(MainForm.DataSource.SETTINGS.Rows[0]["DEF_MEASURE"]);
            }
            else
            {
                RadinfTools.ShowError("SettingsTools.GetDefaultMeasureID()", Globals.ERRORS.NO_SETTINGS_ROW);
            }
            return id;
        }
    }
}
